<?php

$o = f()->users()->user($param);
if ($o === null) {
	echo 'Unknown user.';
} else {
	$form = f()->users()->user_form('edit');
	$form->load($o);
	if ($form->submitted()) {
		$fields = array('user_state','first_name','last_name','user_state','gender','date_of_birth',
			'address','city','state','country','zip','email','phone','mobile');
		$form->save($o,$fields);
		$o->save();
		$this->redirect('@users');
	} else {
		$form->render();
	}
}